<?php 
echo $this->Html->css("chosen");
echo $this->Html->css("dataTables");
echo $this->Html->css("validationEngine.jquery");
?>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/dataTables.min.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/customInput.jquery.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/flot/flot.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/flot/flot.pie.min.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/flot.resize.min.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/flot/graphtable.js"></script>
<script
	type="text/javascript" src="<?php echo $this->webroot; ?>js/chosen.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/zice.custom1.js"></script>
<script
	type="text/javascript" src="<?php echo $this->webroot; ?>js/ColVis.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/layout_table.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/manager_statistic.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/jquery.validationEngine.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/jquery.validationEngine-vi.js"></script>
<script
	type="text/javascript"
	src="<?php echo $this->webroot; ?>js/jquery.autotab.js"></script>

<div class="titlePage">
	<h1>Thống kê</h1>
</div>
<div class="column_left">
	<div class="onecolumn">
		<div class="header">
			<span><span class="ico gray trash_can"></span>Thống kê lợi nhuận</span>
		</div>
		<div class="clear"></div>
		<div class="content">
			<form id="formStatistic" method="post" action="">
				<input id="statisticType" type="hidden" value="1">
				<a class="uibutton special statistic_week">Theo Tuần</a> <a
					class="uibutton confirm statistic_month">Theo Tháng</a> <a
					class="uibutton normal statistic_year">Theo Năm</a>
				<br /> <br /> 
				<div class="week-picker"></div>
				<div class="month-picker"></div>
				<div class="year-picker">
					<?php echo $this->Form->year('purchased', 2013, 2020);?>
					<a class="uibutton" id='btnStatisticYear'>Thống kê</a>
				</div>
				<br /> <br /> 
				<div class="DateInfo section">
					<label>Từ :</label> <input id="startDate" type="text"> - <input id="endDate" type="text">
					<br /> <br /> 
					<a class="uibutton" id='btnStatistic'>Thống kê</a>
				</div>
			</form>
			<div class="clear"></div>
		</div>
		<?php if(!empty($statistic)){ ?>
		<div class="content ">
			<table class="chart-line">
				<thead>
					<tr>
						<th width="10%"></th>
						<th width="29%" style="color: #dc5f59;">Bán sĩ</th>
						<th width="25%" style="color: #bedd17;">Bán lẻ</th>
					</tr>
				</thead>
				<tbody>
					<?php 
					foreach ($statistic as $item) {?>
					<tr>
						<td><?php  echo $item['0']['day'];?></td>
						<td><?php  echo $item['0']['buy'];?></td>
						<td><?php  echo $item['0']['sell'];?></td>
					</tr>
					<?php }?>
				</tbody>
			</table>
		</div>
		<?php } ?>
	</div>
</div>
<div class="column_right">
	<div class="onecolumn">
		<div class="header">
			<span><span class="ico gray resize2"></span>Biểu đồ giá mua bán</span>
		</div>
		<div class="clear"></div>
		<div class="content">
			<form  id="formStatisticP" method="post" action="">
				<input id="statisticType" name="statisticType" type="hidden" value="2">
				<div class="section">
					<label> Chọn sản phẩm: </label>
					<div id="search_product">
						<select class=" choose_product" name="choose_product">
							<?php foreach ($products as $item) {?>
							<option value="<?php echo $item['p']['id']; ?>">
								<?php echo $item['p']['name']." (".$item['u']['father']."/".$item['u']['convert']." ".$item['u']['child'].")";}?>
							</option>
						</select>

					</div>
				</div>
				<a class="uibutton special statistic_week">Theo Tuần</a> <a
				class="uibutton confirm statistic_month">Theo Tháng</a> <a
				class="uibutton normal statistic_year">Theo Năm</a>
				<br /> <br /> 
				<div class="week-picker"></div>
				<div class="month-picker"></div>
				<div class="year-picker">
					<?php echo $this->Form->year('purchased', 2013, 2020);?>
					<br /> <br /> 
					<a class="uibutton" id='btnStatisticPYear'>Thống kê</a>
				</div>
				<br /> <br /> 
				<div class="DateInfo section">
					<label>Từ :</label> <input id="startDate" name="startDate" type="text"> - <input id="endDate" type="text" name="endDate">
					<br /> <br /> 
					<a class="uibutton" id='btnStatisticP'>Thống kê</a>
				</div>
			</form>
		</div>
		<?php if(!empty($statisticP)){?>
		<div class="content ">
			<table class="chart-line">
				<thead>
					<tr>
						<th width="10%"></th>
						<th width="29%" style="color: #dc5f59;">Giá mua</th>
						<th width="25%" style="color: #bedd17;">Giá bán</th>
					</tr>
				</thead>
				<tbody>
					<?php 
					foreach ($statisticP as $item) {?>
					<tr>
						<td><?php  echo $item['0']['day'];?></td>
						<td><?php  echo $item['0']['buy'];?></td>
						<td><?php  echo $item['0']['sell'];?></td>
					</tr>
					<?php }?>
				</tbody>
			</table>
		</div>
		<?php }?>
	</div>
</div>

